﻿$(function () {
    var $headerCheckBox = $("#gvApproveList_cboHeaderVoucher");
    var size = $(".cboItemVoucher").length;
    $headerCheckBox.click(function () {
        if ($headerCheckBox.attr("checked") == "checked") {
            for (var i = 0 ; i < size ; i++) {
                var $itemCheckBox = $("#gvApproveList_cboVoucher_" + i);
                $itemCheckBox.attr("checked", true);
            }
        }
        else {
            for (var i = 0 ; i < size ; i++) {
                var $itemCheckBox = $("#gvApproveList_cboVoucher_" + i);
                $itemCheckBox.attr("checked", false);
            }
        }
    });
});